if(condition) Statements else if(condition) statements else if(condition) statements else : :
a=input("Enter a Number ") a=int(a) if a>0: print("Number is Positive") elif a<0: print("Number is Negative") else: print("Number is Zero")
Enter a Number 56 Number is positive
a,b,c=input("Enter 3 Nos").split() a,b,c=int(a),int(b),int(c) if a>b and a>c: print(a," is Greatest") elif b>c: print(b," is Greatest") else: print(c," is Greatest")
Enter 3 different Numbers 31 19 78 Greatest number is 78
a=input("Enter Salary") a=int(a) if a>=50000: print("A Grade") elif a>=25000: print("B Grade") elif a>=15000: print("C Grade") else: print("D Grade")
Enter Salary 35000 B Grade
a=input("Enter Percentage") a=float(a) if a>=75: print("passed with DT") elif a>=60: print("passed with 1st class") elif a>=40: print("passed") else: print("failed")
Enter Precentage 72 Passed with 1st class
a=input("Enter Gender Code ") if a=="m" or a=="M": print("Male") elif a=="f" or a=="F": print("Female") else: print("Invalid Input")
Enter Gender code M Male